% format: [c1x c1y c1z; c2x c2y c2z]
% n = node
% ls = loudspeaker

y = 6.064;
x = 7.723;

n1 = [0.381 0.080 1.431;0.591 0.080 1.431];
n2 = [4.616 0.075 1.447; 4.832 0.075 1.447];
n3old = [7.319 0.070 1.454; 7.524 0.070 1.454];
n3new = [7.311 0.070 1.495; 7.528 0.070 1.495];
n4 = [5.796 y - 0.060 1.546; 5.576 y - 0.060 1.546];
n5 = [3.451 y - 0.080 1.551; 3.249 y - 0.080 1.551];
n6 = [0.677 y - 0.060 1.566; 0.471 y - 0.060 1.566];
n7 = [0.075 3.174 1.566; 0.075 2.968 1.566];

lsh = 0.782;
ls1 = [2.362, 1.660, lsh];
ls2 = [0.575, 3.037 lsh];
ls3 = [5.815 4.526 lsh];
ls4 = [2.178 4.400 lsh];
ls5 = [4.073 2.986 lsh];
ls6 = [7.346 3.006 lsh];
ls7 = [0.575 3.037 lsh];
ls8 = [4.712 1.333 lsh];
ls9 = [4.730 4.784 lsh];
ls10 = [7.112 5.167 lsh];


nodes = [n1; n2; n3old; n4; n5; n6; n7; n3new;];
ls = [ls1; ls2; ls3; ls4; ls5; ls6; ls7; ls8; ls9; ls10];

plot3(nodes(:, 1), nodes(:, 2), nodes(:, 3), '+', 'linewidth', 2); hold on; grid on;
plot3(ls(:, 1), ls(:, 2), ls(:, 3), '^', 'linewidth', 2);

dist = zeros(length(ls), length(nodes));
for ii = 1:length(ls)
    for jj = 1:length(nodes)
        dist(ii, jj) = norm(ls(ii) - nodes(jj))
    end
end